package com.itheima.d3_inner_class3;

public class Test1 {
    public static void main(String[] args) {
        // 目标：认识匿名内部类，并掌握其作用。
        new  Animal(){
            @Override
            public void cry() {
                System.out.println("汪汪叫");
            }

        };

        Animal animal = new Animal() {
            @Override
            public void cry() {
                System.out.println("嘤嘤嘤");
            }
        };
        animal.cry();


        fly f  = new fly() {
            @Override
            public void Fly() {
                System.out.println("起飞");
            }
        };
        f.Fly();

    }
}





abstract class Animal {
    public abstract void cry();
}